<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
      label-position="top">
      <el-form-item label="开关" prop="gameType" required>
        <el-switch v-model="formData.gameType" :active-value='0' :inactive-value='1'></el-switch>
      </el-form-item>
      <el-form-item label="分红比例" prop="gameUserDividends">
        <el-input-number v-model="formData.gameUserDividends" placeholder="分红比例" controls-position=right>
        </el-input-number>
      </el-form-item>
      <el-form-item label="客服微信" prop="gameCustomerWechat">
        <el-input v-model="formData.gameCustomerWechat" placeholder="请输入客服微信" show-word-limit clearable
          prefix-icon='el-icon-s-custom' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="QQ群链接" prop="gameQqUrl">
        <el-input v-model="formData.gameQqUrl" placeholder="请输入QQ群链接" clearable
          prefix-icon='el-icon-chat-line-round' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="版本号" prop="gameVersion">
        <el-input v-model="formData.gameVersion" placeholder="请输入版本号" clearable
          prefix-icon='el-icon-document-add' :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="apk下载地址" prop="field105">
        <el-input v-model="formData.field105" placeholder="请输入apk下载地址" clearable prefix-icon='el-icon-link'
          :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        gameType: false,
        gameUserDividends: 0,
        gameCustomerWechat: '',
        gameQqUrl: undefined,
        gameVersion: undefined,
        field105: undefined,
      },
      rules: {
        gameUserDividends: [{
          required: true,
          message: '分红比例',
          trigger: 'blur'
        }],
        gameCustomerWechat: [{
          required: true,
          message: '请输入客服微信',
          trigger: 'blur'
        }],
        gameQqUrl: [{
          required: true,
          message: '请输入QQ群链接',
          trigger: 'blur'
        }],
        gameVersion: [{
          required: true,
          message: '请输入版本号',
          trigger: 'blur'
        }],
        field105: [{
          required: true,
          message: '请输入apk下载地址',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
